package com.texplose.mapper;

import com.texplose.entity.User;
import com.texplose.entity.vo.ResponseResult;
import com.texplose.entity.vo.UserInfoVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface UserMapper {
    //用户注册
    void register(@Param("user") User user);

    /*    //用户注册 + 判断
    void registerSelective(@Param("user") User user);*/

    //用户注销 - user_id
    void deleteUser(@Param("userId") Integer userId);

    //通过邮箱更改密码
    void updatePasswordByEmail(@Param("user") User user);

    /*    //通过邮箱更改密码 + 判断
    void updatePasswordByEmailSelective(@Param("user") User user);*/

    //管理员登录
    void adminLogin(@Param("user") User user);

    //普通用户登录
    void login(@Param("user") User user);

    //根据id获取用户
    User getUserById(@Param("userId") Integer userId);

    //获取全部用户
    List<User> selectAllUser();

    User wxLogin(@Param("user") User user);

    void wxRegister(@Param("user") User user);

    List<UserInfoVo> getUserInfo(int id);

    void updateAvatarById(@Param("id") Integer id, @Param("avatarUrl") String avatarUrl);

    Boolean checkUser(@Param("user") User user);

    void updateUserInfo(@Param("userInfo") UserInfoVo userInfo);

    void resetPwdByUserId(@Param("user") User user);

}
